<?php defined('IN_YuLin') || exit('NO PERMIT!'); ?>
{template index/header}
		<div class="subnav">
			<a href="">首页</a> &gt; <a href="">系统管理</a> &gt; <a href="">客服管理</a>
		</div>
		
		<div class="main-inner">
			<div class="x-body">
				<div class="layui-main">
					<div class="formlist">
						<div class="formbox">
							<h5>PC客服设置</h5>
							<ul class="boxlist">
								<!-- <li class="fix"><em>弹窗宽度</em><input maxlength="5" tag="宽度" type="text" class="w150">
									<div class="tip"><p>*</p></div>
								</li>
								<li class="fix"><em>弹窗高度</em><input maxlength="5" tag="高度" type="text" class="w150">
									<div class="tip"><p>*</p></div>
								</li> -->
								<li class="fix"><em>客服链接</em><input maxlength="255" tag="链接" type="text" class="w300 serviceUrl" value="{$service['url']}">
									<div class="tip">
										<p>* 在线客服链接地址，需以http://开头</p>
									</div>
								</li>
							</ul>
						</div>
						<div class="formbox fix">
							<a class="formBtn active saveBtn">提交保存</a><a class="formBtn">还原数据</a>
						</div>
					</div>
				</div>
			</div>
		</div>
		<script>
			$(function(){
				$(".saveBtn").on('click',function(){
					var sUrl = $(".serviceUrl").val().replace(/\s/g,'');
					if(!sUrl.length){
						alert('链接不能为空');return;
					}
					if(sUrl.indexOf('http://') != 0){
						alert('链接地址ttp://开头');return;
					}
					$.ajaxSetup({async:false});
					$.post("?m=system&c=service&a=service_add",{sUrl:sUrl},function(res){
						res = eval('('+res+')');
						alert(res.msg);
						window.location.reload();
					});
				})
			});
		</script>
{template index/footer}
